package io.gitee.hechenl.fastiotreport.service.impl;

import io.gitee.hechenl.fastiotreport.domain.model.ProductDay;
import io.gitee.hechenl.fastiotreport.service.IProductService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;

@Service
public class ProductServiceImpl implements IProductService {
    @Override
    public List<ProductDay> list() {
        return Collections.emptyList();
    }

    @Override
    public BigDecimal getProduct(String unit, LocalDateTime start, LocalDateTime end) {
        if (unit.contains("箱")) {
            return BigDecimal.valueOf(2000);
        } else if (unit.contains("吨")) {
            return BigDecimal.valueOf(1400);
        } else if (unit.contains("千克")) {
            return BigDecimal.valueOf(3000);
        } else {
            throw new RuntimeException("不支持的产量单位");
        }
    }
}
